#include "elemGen.H"
#include "NombreComplexe.H"
#include "Reel.H"

#include <cstdio>
#include "assert.h"


int main()
{
  Element e2;
  Element e1;
  int i = 4;
  bool test;
  initialisation_int(e2);
  affiche_int(e2);
  affectation_int(e2, i);
  affiche_int(e2);
  initialisation_element_int(e1,e2);
  affiche_int(e1);
  printf("e1 est egal a e2\n");
  test = est_egal_int(e1, e2);
  printf("%o \n",test);
  i=6;
  affectation_int(e2, i);
  printf("e1 est superieur a e2 ?\n");
  test = est_superieur_int(e1,e2);
  printf("%o \n",test);
  printf("e1 est inferieur a e2 ?\n");
  test = est_inferieur_int(e1,e2);
  printf("%o \n",test);
  printf("element e1 apres reaffectation de e2 \n");
  affiche_int(e1);
  printf("element e2 apres reaffectation de e2 \n");
  affiche_int(e2);
  testament_int(e2);
  assert(e2 == NULL);
  printf("e2 a bien ete supprime \n");
  affiche_int(e1);
  testament_int(e1);
  initialisation_double(e1);
  double d = 60.125;
  affectation_double(e1,d);
  affiche_double(e1);
  initialisation_element_double(e2,e1);
  affiche_double(e2);
  affectation_double(e1, 120.654);
  printf("affichage de e1 apres reaffectation de e1 \n");
  affiche_double(e1);
  printf("affichage de e2 apres reaffectation de e1 \n");
  affiche_double(e2);
  testament_double(e1);
  assert(e1 == NULL);
  affiche_double(e2);
  testament_double(e2);
  assert(e2 == NULL);
  initialisation_complexe(e1);
  Complexe c;
  c.x = 2;
  c.y = 6;
  affectation_complexe(e1, c);
  affiche_complexe(e1);
  initialisation_element_complexe(e2,e1);
  affiche_complexe(e1);
  affiche_complexe(e2);
  c.x = 3;
  c.y = 5;
  affectation_complexe(e1,c);
  affiche_complexe(e1);
  affiche_complexe(e2);
  testament_complexe(e1);
  testament_complexe(e2);
  assert(e1 == NULL);
  assert(e2 == NULL);
  return 0;
}
